﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lion
{
    /// <summary>
    /// Any cache based type should implement this interface 
    /// to insure type safety
    /// </summary>
    /// <typeparam name="K">the primary key or the ID</typeparam>
    /// <typeparam name="T">the cached type </typeparam>
    public interface ICachedCollection<K, T> where T : class,ICachedCollection<K, T>
    {

        void AddToCache(K ID, T Value);

        /// <summary>
        ///  Removes the value with the specified key from the System.Collections.Generic.Dictionary<TKey,TValue>.
        /// </summary>
        /// <param name="ID">The key of the element to remove.</param>
        /// <returns>true if the element is successfully found and removed; otherwise, false.</returns>
        bool RemoveFromCache(K ID);

        void ClearCollection();


    }
}
